//-----------------------------------------------------------------------
// <copyright file="AddContactCompletedEventArgs.cs" company="Microsoft">
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Microsoft.Live.Messenger
{
    using System;

    /// <summary>
    /// Represents the method that will handle the <see cref="User.AddContactCompleted"/> event of <see cref="User"/>.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">An <see cref="AddContactCompletedEventArgs"/> object that contains event data.</param>
    public delegate void AddContactCompletedEventHandler(object sender, AddContactCompletedEventArgs e);

    /// <summary>
    /// Provides data for the <see cref="User.AddContactCompleted"/> event.
    /// </summary>
    public class AddContactCompletedEventArgs : EventArgs
    {
        private readonly AddContactResultCode resultCode;
        private readonly Contact contact;
        private readonly object userState;

        /// <summary>
        /// Initializes a new instance of the <see cref="AddContactCompletedEventArgs"/> class.
        /// </summary>
        /// <param name="resultCode">The result code.</param>
        /// <param name="contact">The contact that was added.</param>
        /// <param name="userState">The User state.</param>
        public AddContactCompletedEventArgs(
            AddContactResultCode resultCode,
            Contact contact,
            object userState)
        {
            this.resultCode = resultCode;
            this.contact = contact;
            this.userState = userState;
        }

        /// <summary>
        /// Gets the result code.
        /// </summary>
        public AddContactResultCode ResultCode
        {
            get { return this.resultCode; }
        }

        /// <summary>
        /// Gets the contact that was added.
        /// </summary>
        public Contact Contact
        {
            get { return this.contact; }
        }

        /// <summary>
        /// Gets the unique identifier for the asynchronous task.
        /// </summary>
        public object UserState
        {
            get { return this.userState; }
        }
    }
}